<!-- saved from url=(0026)/test.html -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>发布攻略点评 - 骡窝窝</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
    <meta name="format-detection" content="telephone=no,address=no">
    <meta name="referrer" content="always" />
    <meta name="apple-mobile-web-app-capable" content="no" />
    <meta name="apple-mobile-web-app-status-bar-style" content="no" />

    <link href="/css/mobile+css+head-mobile+css+ui%5EYVw%5E1526627473.css" rel="stylesheet" type="text/css">
    <link href="/css/mobile+css+mhead-mobile+css+mdd+poi-mobile+css+album_pop%5EZlM%5E1526627473.css" rel="stylesheet" type="text/css">

    <script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/plugins/form/jquery.form.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        var picNum = [];
        var params;


        $(function () {
            params = getParams()
            var sid = params.strategyId;

            $("#pname").html(decodeURI(params.stitle));
            $(".hdname").attr("href", "/strategyCatalogs.html?strategyId=" + sid)

            // 上传图片
            $("#_j_addpic").click(function () {
                if (picNum.length == 3) {
                    alert('最多上传三张图片哦')
                } else {
                    $("#file").trigger("click")
                }
            });
            // 上传事件
            $("#file").change(function () {

                if ($(this).val()) {
                    $("#picForm").ajaxSubmit({
                        url: "/images",
                        type: "POST",
                        dataType: "json",
                        success: function(data){
                            if (data.status == 1) {
                                var li = '<li class="_j_picitem _j_newitem" id="_j_uploaded_o_'+(picNum.length+1)+'">' +
                                    '<img class="_j_imgitem" id="_j_imgitem_o_'+(picNum.length+1)+'" style="" width="60" height="60" alt=""'+
                                    'src="'+data.url+'"></li>'
                                $("#_j_pluplader_btn_container_1").before(li);
                            }
                            picNum.push(1);
                        },
                        error: function () {
                        }
                    })
                }
            });

            // 选择星星
            $("._j_starlist a[title='千万别去']").click(function () {
                $("#star_c").attr("class", "star _j_starcount star1");
                $("#starNums").val(1);
            });
            $("._j_starlist a[title='不推荐']").click(function () {
                $("#star_c").attr("class", "star _j_starcount star2");
                $("#starNums").val(2);
            });
            $("._j_starlist a[title='一般般']").click(function () {
                $("#star_c").attr("class", "star _j_starcount star3");
                $("#starNums").val(3);
            });
            $("._j_starlist a[title='值得一去']").click(function () {
                $("#star_c").attr("class", "star _j_starcount star4");
                $("#starNums").val(4);
            });
            $("._j_starlist a[title='必须推荐']").click(function () {
                $("#star_c").attr("class", "star _j_starcount star5");
                $("#starNums").val(5);
            });



            // 异步表单
            $("#_j_comment_form").ajaxForm({
                success: function (data) {
                    if (data.success){
                        window.history.back();
                    }
                }
            });

            // 发布点评
            $("#submitBtn").click(function () {
                // 准备数据
                $("#sid").val(sid)
                var urls = "";
                if (picNum.length == 1){
                    urls = $("#_j_imgitem_o_1").attr("src");
                } else if (picNum.length == 2){
                    urls = $("#_j_imgitem_o_1").attr("src") +","+ $("#_j_imgitem_o_2").attr("src");
                } else if (picNum.length == 3){
                    urls = $("#_j_imgitem_o_1").attr("src") +","+ $("#_j_imgitem_o_2").attr("src") +","+ $("#_j_imgitem_o_3").attr("src");
                }
                $("#covers").attr("value" ,urls);
                $("#_j_comment_form").attr("action", "/strategies/addreviews");
                // 提交表单
                $("#_j_comment_form").submit();
            });
        });
    </script>
</head>

<body style="font-size: 24px;">

<style>

    .Review .rating .box {padding:14px 0 0 25px}
    .Review .rating .tips {padding:14px 0 14px}
    .comment_tip {text-align: right; color: #888; padding-top: 5px;}
    .comment_tip em {font-style: normal; color: #666; padding: 0 3px; font-weight: normal;}
    .comment_tip em.red {color: red}
    .del_btn {position: absolute; right: 10px; top: 20px; font-size: 14px; color: #62EC0B;}
    .photos {max-height:110px; overflow:auto}
    .Review .context textarea {min-height:160px; height:160px; overflow:auto}
    .Review .fixedbar {position:static}
    .Review .fixedbar .photos li {width:60px; height:60px; background:#eee; position:relative; padding-right:0; margin-right:15px}
    ._j_unloaded:after {
        border-width: 0 2px 0 0;
        border-style: solid;
        border-color: rgba(0, 0, 0, .7);
        border-radius: 50%;
        display: block;
        height: 40px;
        left: 50%;
        margin: -20px 0 0 -20px;
        position: absolute;
        top: 50%;
        width: 40px;

        content: "";

        animation: spin 1s infinite linear;
        -webkit-animation: spin 1s infinite linear;
    }
    a {cursor:pointer}

</style>
<header class="m-head">
    <a class="btn back" role="button" tabindex="0" id="head_return_btn" href="javascript:void(window.history.length &gt; 1 ? window.history.back() : document.location.href= '/index.html')"></a>
    <div class="bar-c">
        <h1>写点评</h1>
    </div>
    <a class="btn addcomm _j_submit" id="submitBtn" role="button" tabindex="0">发布</a>
</header>
<article class="Review" id="_j_commentcnt">
    <form id="_j_comment_form" method="post">
        <input id="covers" name="coverUrls" type="text" style="display: none">
        <input id="sid" name="strategy.id" type="hidden">
        <a class="hdname" ><i></i><span id="pname"></span></a>
        <section class="rating">
            <div class="box _j_starblock" data-star="" name="rank">
                <input type="hidden" class="_j_rankinput" id="starNums" name="rating" value="" essential="1" data-inputname="评星">
                <div class="review-star"><span class="star _j_starcount " id="star_c"></span></div>
                <div class="click-star _j_starlist">
                    <a role="button" tabindex="0" title="千万别去" rel="nofollow"></a>
                    <a role="button" tabindex="0" title="不推荐" rel="nofollow"></a>
                    <a role="button" tabindex="0" title="一般般" rel="nofollow"></a>
                    <a role="button" tabindex="0" title="值得一去" rel="nofollow"></a>
                    <a role="button" tabindex="0" title="必须推荐" rel="nofollow"></a>
                </div>

                <div class="tips _j_startip"><div>点击星星评分</div></div>
            </div>
        </section>
        <section class="context">
            <textarea placeholder="填写你的点评" id="_j_comment_area" name="content" maxlength="1000"></textarea>
            <div class="comment_tip"></div>
        </section>
        <section class="fixedbar">
            <div class="photos">
                <ul id="_j_piclistcnt">
                    <li id="_j_pluplader_btn_container_1"><a class="add" id="_j_addpic" role="button" tabindex="0">
                        <div id="html5_1cplk82nm16111vdoo725e5ul3_container" class="moxie-shim moxie-shim-html5" style="position: absolute; top: 15px; left: 0px; width: 60px; height: 60px; overflow: hidden; z-index: 0;">

                                <!--<input id="html5_1cplk82nm16111vdoo725e5ul3" name="file" type="file" style="font-size: 999px; opacity: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" accept="image/jpg,image/jpeg,image/bmp,image/gif,image/png">-->

                        </div></a>
                    </li>
                </ul>
            </div>
            <div class="sub-btn" style="display: none;">
                <button type="submit">发布</button>
            </div>
        </section>
    </form>

    <form id="picForm" action="/images" method="post" enctype="multipart/form-data">
        <input id="file" type="file" name="file" style="display: none">
    </form>
</article>
</body>
</html>